package controlPlane;

import wdmsim.Flow;
import events.*;


/**
 * @author alissonslp
 *
 * interface that defines the methods a control plane object must implement
 */
public interface MultidomainControlPlane extends Handler {

	void handle(Event event) throws Exception;
	
	/**
	 * method that handles a route request message
	 * 
	 * @throws Exception 	 
	 */
	void handleRouteRequestEvent(RouteRequestEvent event) throws Exception;
	
	/**
	 * method that handles a route reply message
	 * 
	 * @param event
	 */
	void handleRouteReply(Event event);
	
	/**	 
	 * method that handles an abort message 
	 */
	void handleAbortEvent(Event event);
	
	/**
	 * method that handles a back-track message
	 * 
	 * @throws Exception
	 */
	void handleCrankbackEvent(CrankbackEvent event) throws Exception;
	
	/**  
	 * method that generates a route request message
	 **/
	void generateRouteRequestEvent(Event event);
	
	/**	
	 * method that generates an abort message
	 * 
	 * @throws Exception
	 */
	void generateAbortEvent(Event event) throws Exception;
	
	/**	
	 * method that generates a back-track message
	 */
	void generateCrankbackEvent(RouteRequestEvent event);
	
	/**	
	 * method that generates a route reply message 
	 */
	void generateRouteReply(Event event);

	/**
	 * method that generates messages that releases resources in each domain
	 * a lightpath traverses
	 * 
	 * @throws Exception 
	 */
	void generateDestroyLightpathEvent(Flow flow) throws Exception;
	
	/**	
	 * method that ends the process of lightpath stablishing setting
	 * all the necessary variables to begin data flow
	 * 
	 */
	void createMultidomainLightpath(Flow flow);

}
